package stud.mpgame.net.gameobject;

import org.apache.mina.core.buffer.IoBuffer;

import stud.mpgame.network.Message;
import stud.mpgame.network.UserObject;

import stud.mpgame.snapshot.IGameObject;

/**
 * @author f.pavel91@gmail.com
 * @version 1.0
 */
public class TestGameObject extends UserObject implements IGameObject {

    private int value;

    public TestGameObject(int value) {
        this.value = value;
    }

    public int getID() {
        return 1;
    }

    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }

    public void model(int deltaTime) {

    }

    @Override
    public void writeExternal(IoBuffer buffer, Message owner) {
        buffer.putInt(value);
    }

    @Override
    public String toString() {
        return "\nTestGameObject: " + "VALUE = " + value + "\n";
    }

}
